package com.jc;

import java.util.Scanner;

public class Abs {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		System.out.println("请输入一个整数");
		int n = scan.nextInt();
		
		//求这个整数的绝对值
		int nb = n;   //合理选择初值
		//选择结构  分支结构
		if(n < 0) {
			nb = -n;
		}
		
		System.out.println(n + "的绝对值为：" + nb);
		
		//关闭
		scan.close();
	}
}


package com.jc;

import java.util.Scanner;

public class Score {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		System.out.println("请输入成绩");
		
		int n = scan.nextInt();
		
		int nb = n;
		
		
		
		String s="通过";
		
		if(nb <60) {
			s = "努力";
		}
		
		System.out.println(s);
		
		scan.close();
	}
}

package com.jc;

public class MaxMin {
	public static void main(String[] args) {
		//三个整数  求   最大值   和    最小值
		int a = 5;
		int b = 7;
		int c= 6;
		
		int max = a;  // 最大值		合理选择初值
		
		
		if(b >max) {
			max = b;
		}
		
		if(c > max) {
			max=c;
		}
		
		int min = a;
		
		if(b<a) {
			min=b;
		}
		if(c<a) {
			min=c;
		}
		
		
		System.out.println("最大值为："+ max);
		System.out.println("最小值为："+min);
	}
}


package com.jc;

public class Even {
	public static void main(String[] args) {
		// 判断  奇偶数
		int a = 5;
		
		String s = "";
		
		// if else   如果  否则
		if(a%2==0) {
			s = "偶数";
		}else {
			s = "奇数";
		}
		
		System.out.println(a+"是"+s);
	}
}

package com.jc;

public class Multi {

	public static void main(String[] args) {
		//给出一个成绩
		int n = 66;
		
		
		if(n >= 60) {
			System.out.println("通过");
		}
		else {
			System.out.println("努力");
		}
	}

}
package com.jc;

public class Gift {
	public static void main(String[] args) {
		int n = 98;
		
		if(n >= 80) {
			System.out.println("奖励3本书");
		}
		else if(n >= 60){
			System.out.println("奖励1本书");
		}
		else {
			System.out.println("努力");
		}
	}
}
